<%-- 
    Document   : stude_home
    Created on : Jun 24, 2011, 6:46:22 PM
    Author     : Tyler Powell
--%>

<%@page import="edu.gatech.gellinservlet.model.*"%>
<%@page import="edu.gatech.gellinservlet.presenter.*"%>
<jsp:useBean id="labData" scope="application" class="edu.gatech.gellinservlet.model.LabManager" />
<jsp:useBean id="teamData" scope="application" class="edu.gatech.gellinservlet.model.TeamManager" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="style.css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Student Home Page - Lab Assistant Pro</title>
    </head>
    <body>
        <%@include file="pro_header.jsp" %>
        <%@include file="stude_list.jsp" %>
        <div id="main">
            <h1>Hello <%=userName%>,</h1>
            <h1>Welcome to the Student Page!</h1>
            <% //prints out student info
                String userInfo = "<h3>Your information:</h3>";
                userInfo += "Name: " + aUser.getName() + "<br>";
                userInfo += "Username: " + aUser.getUsername() + "<br>";
                userInfo += "ID: " + aUser.getID() + "<br>";

                userInfo += "Courses You Attend: <br>";
                for (Course aCourse : ((Student) aUser).getCourseList())
                {
                    userInfo += aCourse.getName() + "<br>";
                }

                userInfo += "Your Teams: <br>";
                for (Team aTeam : ((Student) aUser).getTeamList())
                {
                    userInfo += aTeam.getName() + "<br>";
                }

                out.println(userInfo);
            %>
        </div>
    <center>
        <% 
           String errorCode = request.getParameter("msg");
                if ("valid".equals(errorCode))
                    {
                        out.println("<font color=red>Team Created!</font>");
                        System.out.println("Teams in Manager");
                        for(Team aTeam : teamData.getDataList())
                       {
                            System.out.println(aTeam.getName());
                       }
                        System.out.println("Labs in manager");
                        for(Lab aLab : labData.getDataList())
                                                       {
                            System.out.println(aLab.getID() + aLab.getName());
                            System.out.println("teams in lab");
                            for(Team aTeam : aLab.getTeamList())
                                                               {
                                System.out.println(aTeam.getName());
                                                               }
                                                       }
                    }
           %>
    </center>
        <% } //ends user_redirect else statement, html is included here %>
        <% } //ends verifySession.jsp, all html is included in else statment %>
    </body>
</html>

